home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / RTF / rasterfile.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  2KB  |  51 lines

  1. /*    @(#)rasterfile.h 1.11 89/08/21 SMI    */
  2.  
  3. /*
  4.  * Description of header for files containing raster images
  5.  */
  6.  
  7. #ifndef _rasterfile_h
  8. #define _rasterfile_h
  9.  
  10. struct rasterfile {
  11.     int    ras_magic;        /* magic number */
  12.     int    ras_width;        /* width (pixels) of image */
  13.     int    ras_height;        /* height (pixels) of image */
  14.     int    ras_depth;        /* depth (1, 8, or 24 bits) of pixel */
  15.     int    ras_length;        /* length (bytes) of image */
  16.     int    ras_type;        /* type of file; see RT_* below */
  17.     int    ras_maptype;        /* type of colormap; see RMT_* below */
  18.     int    ras_maplength;        /* length (bytes) of following map */
  19.     /* color map follows for ras_maplength bytes, followed by image */
  20. };
  21. #define    RAS_MAGIC    0x59a66a95
  22.  
  23.     /* Sun supported ras_type's */
  24. #define RT_OLD        0    /* Raw pixrect image in 68000 byte order */
  25. #define RT_STANDARD    1    /* Raw pixrect image in 68000 byte order */
  26. #define RT_BYTE_ENCODED    2    /* Run-length compression of bytes */
  27. #define RT_FORMAT_RGB    3    /* XRGB or RGB instead of XBGR or BGR */
  28. #define RT_FORMAT_TIFF    4    /* tiff <-> standard rasterfile */
  29. #define RT_FORMAT_IFF    5    /* iff (TAAC format) <-> standard rasterfile */
  30. #define RT_EXPERIMENTAL 0xffff    /* Reserved for testing */
  31.  
  32.     /* Sun registered ras_maptype's */
  33. #define RMT_RAW        2
  34.     /* Sun supported ras_maptype's */
  35. #define RMT_NONE    0    /* ras_maplength is expected to be 0 */
  36. #define RMT_EQUAL_RGB    1    /* red[ras_maplength/3],green[],blue[] */
  37.  
  38. /*
  39.  * NOTES:
  40.  *     Each line of the image is rounded out to a multiple of 16 bits.
  41.  *   This corresponds to the rounding convention used by the memory pixrect
  42.  *   package (/usr/include/pixrect/memvar.h) of the SunWindows system.
  43.  *    The ras_encoding field (always set to 0 by Sun's supported software)
  44.  *   was renamed to ras_length in release 2.0.  As a result, rasterfiles
  45.  *   of type 0 generated by the old software claim to have 0 length; for
  46.  *   compatibility, code reading rasterfiles must be prepared to compute the
  47.  *   true length from the width, height, and depth fields.
  48.  */
  49.  
  50. #endif /*!_rasterfile_h*/
  51.